  <?php include _include(APP_PATH.'view/htm/header.inc.htm');?>

  <!--{hook index_start.htm}-->
  <div class="container jumbo position-relative px-0" style="border-radius:8px;box-shadow: 0 0px 10px #616161;">
    <img src="" class="w-100" alt="">
  </div>
  <div class="my-3 center">
    <button class="t_label">CTF 团队排行</button>
  </div>
  <table class="table table-hover my-3" style="background: white; border-radius:5px 5px 5px 5px;">
    <thead class="member_list_th">
      <tr class="text-dark">
        <th class="text-center">排名</th>
        <th class="text-center rank_number_placeholder">&nbsp;</th>
        <th>团队名称</th>
        <th class="text-center">加入</th>
        <th class="text-center">总分</th>
        <th class="text-center rank_number_placeholder">注册时间</th>
      </tr>
    </thead>
    <tbody class="member_list text-dark" style="font-size:13px;">
      <?php
      $array = db_find('ctf','',['points'=>-1],1,10,'',['id','name','avatar','points','creattime']);
              foreach($array as $key=>$value[]){
              $id = $value[$key]['id'];
              $name = $value[$key]['name'];
              $avatar = $value[$key]['avatar'];
              $points = $value[$key]['points'];
              $creattime = $value[$key]['creattime'];
              $url = url("ctf-team_$id");
              $pm = "";
              switch($key){
              case 0:
              $pm = '<img src="/plugin/mu_ctf/view/img/rank1.png" style="max-height:25px">';
              break;
              case 1:
              $pm = '<img src="/plugin/mu_ctf/view/img/rank2.png" style="max-height:25px;">';
              break;
              case 2:
              $pm = '<img src="/plugin/mu_ctf/view/img/rank3.png" style="max-height:25px;">';
              break;
              default:
              $pm = $key + 1;
              break;
            }
            echo '<tr class="rank_number" style="display: table-row;"><th scope="row" class="text-center rank_number_">'.$pm.'</th><td class="text-center rank_number_placeholder">&nbsp;</td><td style="vertical-align: inherit;"><a href="'.$url.'"><img src="'.$avatar.'" class="img-circle" width="25px" style="width: 26px;border-radius: 15rem;">'.$name.'</a></td><td style="text-align:center;"><span data-toggle="modal" data-target="#teamJoin" onclick="joinTeam('.$id.')">加入</span></td><td class="text-center" style="vertical-align: inherit;">'.$points.'</td><td class="text-center rank_number_placeholder" style="vertical-align: inherit;">'.$creattime.'</td></tr>';
          }
      ?>
    </tbody>
  </table>
  <!--{hook index_end.htm}-->
  
  <?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>